---
id: 660f2b6fd54ac1fc142804dd
title: Step 42
challengeType: 1
dashedName: step-42
---

# --description--

The logic for formatting this pyramid is likely going to get complicated, which means it's a great time to extract that code into a function.

A <dfn>function</dfn> is a block of code that can be reused throughout your application. Functions are declared with the following syntax:

```js
function name(parameter) {

}
```

The `function` keyword tells JavaScript that the `name` variable is going to be a function. `parameter` is a variable that represents a value that is passed into the function when it is used. A function may have as many, or as few, <dfn>parameters</dfn> as you'd like. Like a `for` loop, the space between the curly braces is the <dfn>function body</dfn>.

Declare a `padRow` function. Do not create any parameter variables yet. The function body should be empty. Remember that you need to use camel case for your naming convention.

# --hints--

You should use the `function` keyword.

```js
assert.match(code, /function/);
```

You should declare a `padRow` function.

```js
assert.isFunction(padRow);
```

Your `padRow()` function should not have any parameters.

```js
assert.match(code, /padRow\s*\(\s*\)/);
```

Your `padRow()` function should have an empty body.

```js
assert.match(code, /padRow\s*\(\s*\)\s*\{\s*\}/);
```

# --seed--

## --seed-contents--

```js
const character = "#";
const count = 8;
const rows = [];

--fcc-editable-region--

--fcc-editable-region--


for (let i = 0; i < count; i = i + 1) {
  rows.push(character.repeat(i + 1))
}

let result = ""

for (const row of rows) {
  result = result + "\n" + row;
}

console.log(result);
```
